package com.qingcloud.adminbackend.enums;

public enum UserRoleEnum {

    DATE_ANALYZE(105, "数据分析"),
    PRESALE_ID(102, "售前"),
    SERVICER_ID(103, "客服"),
    OPS_ID(104, "运维"),
    DATA_QUALITY_ID(106, "数据质控"),
    SALESMAN_ID(101, "销售"),
    WAMING_MANAGER_ID(107, "蛙鸣管理员"),
    COMPANY_USER_ID(203, "企业用户"),
    COMPANY_MANAGER_ID(201, "企业管理员"),
    COMPANY_EQUIPMENT_MANAGER_ID(202, "企业设备管理员");

    public Integer code;

    public String name;

    UserRoleEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(int code) {
        UserRoleEnum[] uss = values();
        for (UserRoleEnum us : uss) {
            if (us.code == code) {
                return us.name;
            }
        }
        return null;
    }
}
